skobki=input()
iyyy='yes'
mass=[]
for i in skobki:
    if '[' == i == '(' or i == '{':
        mass.append(i)
    elif mass:
        if ']' == i and mass[-1] == '[':
            mass.pop()
        elif ')' == i and mass[-1] == '(':
            mass.pop()
        elif '}' == i and mass[-1] == '{':
            mass.pop()
        else:
            iyyy = 'no'
    else:
         iyyy='no'
print(iyyy)
